/*
 * @Author: szx
 * @Date: 2022-03-31 12:31:39
 * @LastEditTime: 2022-03-31 12:36:13
 * @Description:
 * @FilePath: \leetcode\700-799\728\728.js
 */
/**
 * @param {number} left
 * @param {number} right
 * @return {number[]}
 */
var selfDividingNumbers = function (left, right) {
    let res = [];
    for (let i = left; i <= right; i++) {
        let j = i;
        while (j > 0) {
            if (i % (j % 10) != 0) break;
            j = Math.floor(j / 10);
        }
        if (j == 0) res.push(i);
    }
    return res;
};
